
% If joh=true then we limit the cases to those where our method can be
% compared to the Johansen test.

joh=true

if joh
    
    % names of the DGPs
    cases={'simul3_1','simul3_2','simul3_3','simul3_4'};    
    % unit roots (first row 1, second row, -1)
    rts={[0 0 0; 0 0 0],[0 0 1; 0 0 0],[0 1 1; 0 0 0],[1 1 1; 0 0 0]}; 
    % order of the DGP
    ord=[1 1 1 1];                           
    
else
    cases={'simul3_1','simul3_2','simul3_3','simul3_4','simul3_5',...
        'simul3_6','simul3_7','simul3_8','simul3_9','simul3_10','simul3_11'};
    rts={[0 0 0; 0 0 0],[0 0 1; 0 0 0],[0 1 1; 0 0 0],[1 1 1; 0 0 0],...
        [0 0 2; 0 0 0],[0 1 2; 0 0 0],[1 1 2; 0 0 0],[0 2 2; 0 0 0],...
        [1 2 2; 0 0 0],[2 2 2; 0 0 0],[0 0 1; 0 0 1]};
    ord=[1,1,1,1,2,2,2,2,2,2,2];
end


s=2;

% Functions to control the dependence of the parameter of the approximate
% method on the length of the series.

e1fun=@(T) T.^(-1/3)
e2fun=@(T) T.^(-1/3)

M=500       % Number of simulations
n=3         % dimension
T0=50;      % first point of the series-length grid.
T1=500;     % last point of the series-length grid.

% call to the function that runs along the grid

[pcmat, pcvmat, pcomat, pcjmat, Tgrid]=sequence_simul_nodiv2(M,T0,T1,e1fun,e2fun,n,s,cases,rts,ord,joh)

% generate graphs

graf_table